package at.meder.evaluation.model;

import java.util.ArrayList;
import java.util.List;

import at.meder.evaluation.editors.CostsEditor;
import at.meder.evaluation.editors.SoapHeaderEditor;

public class CriteriaProvider {
	
	
	private static CriteriaProvider provider;
	private List<Criterion> criteria = new ArrayList<Criterion>();

	
	private CriteriaProvider() {
		Criterion criterion = new Criterion();
		criterion.setShortname("G2");
		criterion.setName("Costs");
		criterion.setEditorId(CostsEditor.ID);
		criterion.setMetric1_name("MC1 - Costs of framework (SDK & libraries)");
		criterion.setMetric2_name("MC2 - Costs of IDE");
		criterion.setMetric3_name("MC3 - Costs of documentation");
		criterion.setMetric1("");
		criterion.setMetric2("");
		criterion.setMetric3("");
		
		criterion.setId(1);
		criteria.add(criterion);
		
		
		
		criterion = new Criterion();
		criterion.setShortname("S1");
		criterion.setName("SOAP Header");
		criterion.setMetric1_name("MS1 - Count SOAP Header elements = 0");
		criterion.setMetric2_name("MS1 - Count SOAP Header elements = 1");
		criterion.setMetric3_name("MS2 - Count SOAP Header blocks");
		criterion.setMetric1("");
		criterion.setMetric2("");
		criterion.setMetric3("");
		
		criterion.setId(2);
		criterion.setEditorId(SoapHeaderEditor.ID);
		
		criteria.add(criterion);
		
	}

	
	
	public static CriteriaProvider getInstance() {
		if (provider == null) {
			provider = new CriteriaProvider();
		}
		return provider;
	}



	public List<Criterion> getCriteria() {
		return criteria;
	}
	
	
	public Criterion getCriterionById(int id){
		
		for (Criterion criterion : criteria) {
			if (criterion.getId() == id) {
				return criterion;
			}
		}
		return null;

		
	}
	
	
	
}
